package com.light.applet.common.redis;

import java.util.concurrent.TimeUnit;

/**
 * @author 魏彪
 */
public interface KeyPrefix {
    String prefix();

    int timeout();

    TimeUnit timeUnit();

    default String joinKey(String... suffix) {
        StringBuilder sb = new StringBuilder();
        sb.append(prefix());
        for (String s : suffix) {
            sb.append(":").append(s);
        }
        return sb.toString();
    }
}
